package com.liboteng.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class LoginController {
    @RequestMapping("login")
    public String login()
    {
        return "login.html";
    }

    @RequestMapping("loginCommit")
    public String loginCommit(String username, String password, Model model)
    {
        if (username.equals("Roff") && password.equals("lbt")) {
            model.addAttribute("name",username);
            return "home.html";
        }
        return "login.html";
    }
}
